<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<button id="btn">添加列表项目</button>
<ul id="list">
    <li>列表项目1</li>
    <li>列表项目2</li>
    <li>列表项目3</li>
</ul>

<script>

var ul=document.getElementById("list");
ul.addEventListener('click',function(e){
	var e = e || window.event;
	var target = e.target || e.srcElement;	
	if(e.target&&e.target.nodeName.toUpperCase()=="LI"){/*判断目标事件是否为li*/
		alert(e.target.innerHTML);
	}
},false);


var i = 4;
var btn=document.getElementById("btn");
btn.addEventListener("click",function(){
	var li = document.createElement("li");
	li.innerHTML = "列表项目" + i++;
	ul.appendChild(li);
});

</script>
</body>
</html>
